@extends('layouts.app')

@section('content')
    <div class="content">
        <div class="header">
            <ul class="breadcrumb">
                <li><i class="fa fa-fw fa-cog"></i>组织管理</li>
                <li>部门列表</li>
            </ul>
        </div>
        <div class="main-content">
            <div class="btn-toolbar list-toolbar">
                <a href="{{url('admin/org/add_bumen',$id)}}" class="btn btn-primary add-user"><i class="fa fa-plus"></i>添加</a>
                &nbsp;&nbsp;<a href="{{url('admin/org/index')}}" class="btn btn-warning add-user">返回上级</a>
                <div class="form-all">
                    <table class="table table-form table-striped table-bordered table-condensed">
                        <thead>
                        <tr>
                            <th width="80">序号</th>
                            <th>部位名称</th>
                            <th>负责人</th>
                            <th>修改时间</th>
                            <th>操作人</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach ($res as $key=>$re)
                            <tr>
                                <td>{{ $key+1 }}</td>
                                <td>{{ $re->name }}</td>
                                <td>{{ $re->fuzeren }}</td>
                                <td>{{ $re->updated_at }}</td>
                                <td><span style="color:#599de6">{{ getValue($re->user_id,'admin_users','id','name') }}</span></td>
                                <td>
                                    <a href="{{url('admin/org/edit_bumen',$re->id)}}" class="label label-success tag">编辑</a>
                                    <a href="{{url('admin/org/del_bumen',$re->id)}}" class="label label-danger tag del">删除</a>
                                </td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                </div>
                <span>共{{$count}}条数据</span>
                <ul class="pagination pull-right">
                    {{ $res->render() }}
                </ul>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        function check() {
            $('#search_form').submit();
        }

        $('.del').click(function(){
            var i=window.confirm("确认删除该条数据？");
            if(i==0){
                return false;
            }
        });
    </script>
@stop

